﻿<UserControl x:Class="Jbe.TestSuite.Message.Demo.Presentation.DemoView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="http://www.codeplex.com/CompositeExtensions/TestSuite/Interface"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:cae="http://www.codeplex.com/CompositeExtensions"
    xmlns:p="clr-namespace:Jbe.TestSuite.Message.Demo.Properties"
    xmlns:d="clr-namespace:Jbe.TestSuite.Message.Demo.Domain"
    cae:ResourceService.MergeSharedDictionaries="{x:Static i:ResourceHelper.SharedResourcePath}">
    
    <UserControl.Resources>
        <ObjectDataProvider x:Key="MessageTypeValues" ObjectType="sys:Enum" MethodName="GetValues">
            <ObjectDataProvider.MethodParameters>
                <x:Type x:Type="d:MessageType" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>

    <ScrollViewer VerticalScrollBarVisibility="Auto">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="11"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="11"/>
            </Grid.ColumnDefinitions>

            <Label Content="{x:Static p:Resources.EnterMessage}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource Label.Header}"/>

            <Label Content="{x:Static p:Resources.MessageType}" Grid.Row="1" Grid.Column="0"/>
            <ComboBox SelectedItem="{Binding MessageType}" ItemsSource="{Binding Source={StaticResource MessageTypeValues}}" Grid.Row="1" Grid.Column="1"/>

            <Label Content="{x:Static p:Resources.Message}" Grid.Row="2" Grid.Column="0" Margin="11,7,0,0"/>
            <TextBox Text="{Binding Message}" Grid.Row="2" Grid.Column="1" Margin="11,7,0,0"/>

            <Label Content="{x:Static p:Resources.Details}" Grid.Row="3" Grid.Column="0" Margin="11,7,0,0"/>
            <TextBox Text="{Binding Details}" Grid.Row="3" Grid.Column="1" Margin="11,7,0,0"/>

            <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
                <Button Content="{x:Static p:Resources.ShowDialog}" Command="{Binding ShowDialogCommand}"/>
                <Button Content="{x:Static p:Resources.ShowStatusBar}" Command="{Binding ShowStatusBarCommand}"/>
            </StackPanel>

            <Label Content="{x:Static p:Resources.ThrowExceptionTitle}" Grid.Row="5" Grid.Column="0"/>
            <RadioButton Content="{x:Static p:Resources.Exception}" IsChecked="{Binding ThrowExceptionOption}" Grid.Row="5" Grid.Column="1" VerticalAlignment="Bottom"/>
            <RadioButton Content="{x:Static p:Resources.AuthenticationException}" IsChecked="{Binding ThrowAuthenticationExceptionOption}" Grid.Row="6" Grid.Column="1" Margin="11,7,0,0"/>

            <Button Content="{x:Static p:Resources.ThrowException}" Command="{Binding ThrowExceptionCommand}" Grid.Row="7" Grid.Column="1"/>
        </Grid>
    </ScrollViewer>
</UserControl>
